package org.roy.uibase.field;

import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

import org.roy.uibase.Rect;
import org.roy.uibase.event.Event;
import org.roy.uibase.event.EventHandle;



public abstract class Field implements EventHandle{
    protected Rect iBoundRect = new Rect(0, 0, 0, 0);
    protected int iBgrColor;
    protected int iTextColor;
    
    protected Image iBgrImage = null;
    
    protected boolean isFocus = false;
    
    protected Field iParent;
    protected Font iFont = Font.getDefaultFont();
    
    public void setBoundRect(Rect aRect){
        iBoundRect = aRect;
    }
    
    public void setPos(int ax, int ay){
        iBoundRect.setPos(ax, ay);
    }
    
    public void resize(int aw, int ah){
        iBoundRect.setWidth(aw);
        iBoundRect.setHeight(ah);
    }
    
    public Rect getBoundRect(){
        return iBoundRect;
    }
    
    public abstract int minHeight();
    public abstract int minWidth();
    public abstract void paint(Graphics aGraphics);
    
    public boolean handleEvent(Event aEvent){
        return false;
        
    }
}
